<!DOCTYPE html>
<html>
<body>
<div id=container>
<input placeholder="first line &#13;&#10;second line"><br>
<input placeholder="&#13;"><br>
<textarea placeholder="first line &#13;&#10;second line"></textarea><br>
<textarea placeholder="&#10;"></textarea>
<textarea placeholder="&#13;"></textarea>
</div>
<script src="../../resources/js-test.js"></script>
<script>
description('CR and LF in placeholder values should be stripped for input type. For textarea should not be stripped.');

if (window.internals) {
    var input0 = document.getElementsByTagName('input')[0];
    var input1 = document.getElementsByTagName('input')[1];
    var textarea0 = document.getElementsByTagName('textarea')[0];
    var textarea1 = document.getElementsByTagName('textarea')[1];
    var textarea2 = document.getElementsByTagName('textarea')[2];
    shouldBeEqualToString('internals.visiblePlaceholder(input0)', 'first line second line');
    shouldBeEqualToString('internals.visiblePlaceholder(input1)', '');
    shouldBeEqualToString('internals.visiblePlaceholder(textarea0)', 'first line \nsecond line');
    shouldBeEqualToString('internals.visiblePlaceholder(textarea1)', '');
    shouldBeEqualToString('internals.visiblePlaceholder(textarea2)', '');

    document.body.removeChild(document.getElementById('container'));
} else {
    debug('The first input element should have a placeholder "first line second line", and the second input element should have nothing.');
    debug('The first textarea element should have a placeholder "first line &#13;&#10;second line", and the second input element should have nothing');
}
</script>
</body>
</html>
